package pers.hubb;

public class Utils {

	private Utils() {}

	public static void recordStackTrace(Thread thread) {
		StackTraceElement[] stackTrace = thread.currentThread().getStackTrace();
		if (null == stackTrace || stackTrace.length == 0) {
			return;
		}
		StringBuffer stackTracePath = new StringBuffer();
		for (int i = 2; i < stackTrace.length; i++) {
			StackTraceElement stackTraceElement = stackTrace[i];
			stackTracePath.append("<-" + stackTraceElement.getClassName() + "." + stackTraceElement.getMethodName());
		}
		System.out.println(stackTracePath.toString().substring(2, stackTracePath.toString().length()));
	}
}
